﻿using System;

namespace SBPweb.Twitter.Host.Connectivity
{

    public class ServiceResultCode
    {

        #region Constants

        public const int UnknownValue = -1;
        public const int OkValue = 0;
        public const int ErrorValue = 1;

        #endregion

        #region Constructor logic

        internal ServiceResultCode()
        {
        }

        internal ServiceResultCode(int value)
        {
            Value = value;
        }

        public static ServiceResultCode CreateByCode(int value)
        {
            return new ServiceResultCode(value);
        }

        #endregion

        #region Property accessors

        public int Value;

        public static readonly ServiceResultCode Unknown = new ServiceResultCode(UnknownValue);
        public static readonly ServiceResultCode Ok = new ServiceResultCode(OkValue);
        public static readonly ServiceResultCode Error = new ServiceResultCode(ErrorValue);

        #endregion

        #region Methods

        public override bool Equals(object obj)
        {
            return Value.Equals(obj);
        }

        public override string ToString()
        {
            return Value.ToString();
        }

        #endregion

    }

}